﻿@using CV.Resources.View.Login

@model CV.Entities.Models.LoginModel

@{
    ViewBag.Title = Index.Title;
}

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">
        @if (!String.IsNullOrWhiteSpace(Model.ErrorMessage))
        {
            <div class="form-group">
                <div class="panel panel-danger">
                    <div class="panel-heading">@Index.Message</div>
                    <div class="panel-body">
                        @Html.DisplayFor(model => model.ErrorMessage)
                    </div>
                </div>
            </div>
        }
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        <div class="form-group">
            @Html.LabelFor(model => model.Login, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Login, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Login, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Password, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.PasswordFor(model => model.Password, htmlAttributes: new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.Password, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-8">
                <input type="submit" value="@Index.LogIn" class="btn btn-primary" />
            </div>
            <div class="col-md-2">
                <span class="pull-right">
                    @Html.ActionLink(Index.SignUp, "Signup", null, new { @class = "btn btn-default" })
                </span>
            </div>
        </div>
    </div>
}

@section scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
